package com.bktalk;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;

public class TestAcitivityActivity extends Activity {
	Button button1 = null;
	
	EditText add1 = null;
	EditText add2 = null;
	
	OnClickListener clicklistener  = new OnClickListener()
	{
		@Override
		public void onClick(View v) {
			Intent intent = new Intent();
			intent.setClass(TestAcitivityActivity.this, SecondActivity.class);		
			intent.putExtra("add1", Integer.valueOf(add1.getText().toString()));
			intent.putExtra("add2", Integer.valueOf(add2.getText().toString()));
			TestAcitivityActivity.this.startActivity(intent);
		}
		
	};
	
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
    	System.out.println("onCreate");
    	
    	add1 = (EditText)findViewById(R.id.add1);
    	add2 = (EditText)findViewById(R.id.add2);
    	
    	Button button1 = (Button)this.findViewById(R.id.button1);
    	button1.setOnClickListener(clicklistener);
    }
    /*
    public void onStart()
    {
    	System.out.println("onStart");
    	super.onStart();
    }
    
    protected void onRestart()
    {
    	System.out.println("onRestart");
    	super.onRestart();
    }
    
    protected void onResume()
    {
    	System.out.println("onResume");
    	super.onResume();
    }
    
    protected void onPause()
    {
    	System.out.println("onPause");
    	super.onPause();
    }
    
    protected void onStop()
    {
    	System.out.println("onStop");
    	super.onStop();
    }
    
    protected void onDestroy()
    {
    	System.out.println("onDestroy");
    	super.onDestroy();
    }
    */
}